/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/

#ifndef DVPP_DMA_CTRL_H
#define DVPP_DMA_CTRL_H

#include <linux/types.h>

#include "dvpp_svm_mem_ctrl.h"

typedef struct {
    uint64_t vir_addr;
    uint64_t phy_addr;
} dvpp_dma_mem; // 如果结构体变大，需修改DVPP_DEFAULT_MEM_BLK_SIZE

void* dvpp_dma_alloc(uint32_t dev_id, size_t size, dma_addr_t *dma_addr, gfp_t gfp);
void dvpp_dma_free(uint32_t dev_id, size_t size, void *addr, dma_addr_t dma_addr);
int32_t dvpp_dma_sync_link_copy(uint32_t dev_id, dvpp_dma_mem *dma_mem, dvpp_svm_pa_info *pa_info);

#endif // #ifndef DVPP_DMA_CTRL_H